<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8' />
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <link href='../../mapbox-gl.css' rel='stylesheet' />
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }

    </style>
</head>

<body>
    <div id='map'></div>
    <script type="text/javascript" src='../../libs/jquery.min.js'></script>
    <script type="text/javascript" src='../../mapbox-gl-dev.js'></script>
    <script type="text/javascript" src="../../iclient9-mapboxgl.js"></script>
    <script>
        var map = new mapboxgl.Map({
            container: 'map', // container id
            style: {
                "version": 8,
                "sources": {
                    "raster-tiles": {
                        "type": "raster",
                        "tiles": ['http://t0.tianditu.com/DataServer?T=vec_c&x={x}&y={y}&l={z}'],
                        "tileSize": 256
                    }
                },

                "layers": [{
                    "id": "simple-tiles",
                    "type": "raster",
                    "source": "raster-tiles",
                    "minzoom": 0,
                    "maxzoom": 22
                }]
            },
            crs:'EPSG:4326',
            center: [0, 0], // starting position
            zoom: 2 // starting zoom
        });

        map.on('load', function () {
            var heatMapLayer = new mapboxgl.supermap.HeatMapLayer(
                "heatMap", {
                    "map": map,
                    "id": "heatmap",
                    "radius": 20
                }
            );
            $.getJSON("../../data/earthquakes.geojson",function(heatPoints){
                heatMapLayer.addFeatures(heatPoints);
                map.addLayer(heatMapLayer)
            })
            
        });

    </script>

</body>

</html>
